import java.util.Scanner;
import java.util.ArrayList;
import java.util.List;


public class Main {

        public static void main(String[] args) {
                Scanner input = new Scanner(System.in);
                System.out.println("Please enter an integer to see its properties");
                int number = input.nextInt();
                System.out.println("Perfect square: " + alican_isSquare(number));
                System.out.println("Prime number: " + ecr_isPrime(number));
                System.out.println("Pallindrome: "+ behcet_isPallindrome(number));
                System.out.println("Perfect number: " + berkin_isPerfect(number));
                System.out.println("Even number: " + mert_isEven(number));
                System.out.println("Narcisstic: " + yas_isNarcissistic(number));
                System.out.println("Odd number: " + aydan_isOdd(number));
        }
        
        public static boolean alican_isSquare(int number){
                int k = (int)Math.sqrt(number);
                return k*k==number;
                
        }
   
   public static boolean ecr_isPrime(int number){
                if (number%2 == 0) {    //check evenness
                        return false;
                } else {
                        for (int i = 3; i*i < number; i+=2) {
                                if (number%i == 0) {
                                        return false;
                }       }       } //end else, for, if
                return true;
        }
   
        public static boolean behcet_isPallindrome(int number){ 
                String num = Integer.toString(number);
                for(int i=0; i<num.length()/2; i++){
                        if(num.charAt(i) != num.charAt(num.length()-1-i))
                                return false;
                }
                return true;
        }
        public static boolean berkin_isPerfect(int num){
                int perfectNo = 0;
                int i;
                for (i = 1; i < num; i++) {
                        if (num % i == 0) {
                                perfectNo += i;
                        }
                }
                if (perfectNo == num) {
                        return true;
                } else {
                        return false;
                }
        }
        
        public static boolean mert_isEven(int num) {
            return num % 2 == 0;
        }

    public static boolean yas_isNarcissistic(int num){

        return isNarcissistic(num) ;
    }

    private static boolean isNarcissistic(int i){
        List digits = listOfDigits(i);
        double totalPowerOfDigits = powOfDigits(digits);

        if(totalPowerOfDigits == i){
            return true;
        }

        return false;
    }

    private static double powOfDigits(List digits) {
        double cube = 0;
        int sz = digits.size();
        for(int i = 0; i< digits.size(); i++){
            cube = (cube + Math.pow((Integer)digits.get(i), sz));
        }

        return cube;
    }


    private static void printDigits(List digits){
        System.out.println(digits.toString());
    }

    private static List listOfDigits(int i) {
        List digits = new ArrayList();
        int rem = 0;
        while(i/10 >0){
            rem = i % 10;
            digits.add(rem);
            i = i/10;
        }
        rem = i;
        digits.add(rem);

        return digits;
    }

 public static boolean aydan_isOdd(int num) {
            return num % 2 == 1;
        }
}